package com.wyp.design.pattern.behavior.chainofresponsibility;

import org.apache.commons.lang.StringUtils;

/**
 * ArticleApprover 类,主要用来判断article是否为空.,以及是否进行下一个调用链处理
 */
public class ArticleApprover extends Approver {
    @Override
    public void deploy(Course course) {
        if (StringUtils.isNotEmpty(course.getArticle())) {
            System.out.println(course.getName() + "含有手记,批准");
            if (approver != null) {
                approver.deploy(course);
            }
        } else {
            System.out.println(course.getName() + "不含有手记,不批准,流程结束");
            return;
        }
    }
}
